﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Sunny.UI;
using Nero_demo.Westward;

namespace Nero_demo
{
    partial class TaskConfigForm : UIForm
    {
        public TaskConfigForm(ProcessHelper processHelper)
        {
            InitializeComponent();

            this.processHelper = processHelper;

            InitUI();
        }

        private void InitUI()
        {
            TaskConfig tc = processHelper.GetTaskConfig();
            cbWaitZero.Checked = tc.IsWaitZeroClock;
            cbMap.Checked = tc.IsTreasureMap;
            cbSecret.Checked = tc.IsSecretTask;
            cbGhost.Checked = tc.IsSearchGhostTeam;
            cbExpress.Checked = tc.IsExpress;
            cbInstance.Checked = tc.IsSearchInstanceTeam;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            TaskConfig tc = new TaskConfig();
            tc.IsWaitZeroClock = cbWaitZero.Checked;
            tc.IsTreasureMap = cbMap.Checked;
            tc.IsSecretTask = cbSecret.Checked;
            tc.IsSearchGhostTeam = cbGhost.Checked;
            tc.IsExpress = cbExpress.Checked;
            tc.IsSearchInstanceTeam = cbInstance.Checked;

            processHelper.SetTaskConfig(tc);

            this.Close();
        }

        private ProcessHelper processHelper;
    }
}
